using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Rotempco.Core.CSV.Objects
{
    public class CSVMapping<T>
    {
        public CSVParameterMappingContainer<T> CSVParameterMappingContainer { get; set; }
        public int SkipLines { get; set; }
        public char Delimiter { get; set; }
        public bool StopOnError { get; set; }
        public bool SoftMapping { get; set; }
        public Encoding EncodingType { get; set; }
        public Func<string, string> RunOnAllCSVEntries { get; set; }

        public CSVMapping(CSVParameterMappingContainer<T> csvParameterMappingContainer, int skipLines = 0, char delimiter = ';', bool stopOnError = false, bool softMapping = false, Func<string, string> runOnAllCSVEntries = null)
            : this(csvParameterMappingContainer, Encoding.Default, skipLines: skipLines, delimiter: delimiter, stopOnError: stopOnError, softMapping: softMapping, runOnAllCSVEntries: runOnAllCSVEntries)
        {
        }

        public CSVMapping(CSVParameterMappingContainer<T> csvParameterMappingContainer, Encoding encodingType, int skipLines = 0, char delimiter = ';', bool stopOnError = false, bool softMapping = false, Func<string, string> runOnAllCSVEntries = null)
        {
            CSVParameterMappingContainer = csvParameterMappingContainer;
            SkipLines = skipLines;
            Delimiter = delimiter;
            StopOnError = stopOnError;
            SoftMapping = softMapping;
            EncodingType = encodingType;
            RunOnAllCSVEntries = runOnAllCSVEntries;
        }

    }
}
